﻿using System;
using NetBrick.Common.Packets;

namespace NetBrick.Client.Handler
{
    public class EstablishEncryptionPacketHandler : PacketHandler
    {
        public EstablishEncryptionPacketHandler(Client client)
            : base(client)
        {
        }

        public override void Process(Object packetData)
        {
            var establishEncryptionPacket = (EstablishEncryptionPacket.Response) packetData;
            Client.InitEncryption(establishEncryptionPacket.KeyXml);
            Client.DebugInfo("Initialized encryption.");
        }
    }
}